package c.e.a.b.f.b;

import android.net.Uri.Builder;
import android.os.Bundle;
import android.text.TextUtils;
import c.e.a.b.b.j.c;
import java.util.Objects;

/* compiled from: com.google.android.gms:play-services-measurement-impl@@18.0.0 */
public final class y9 {
    public final u4 a;

    public y9(u4 u4Var) {
        this.a = u4Var;
    }

    public final void a(String str, Bundle bundle) {
        this.a.a().g();
        if (!this.a.i()) {
            CharSequence charSequence;
            if (bundle == null || bundle.isEmpty()) {
                charSequence = null;
            } else {
                if (str == null || str.isEmpty()) {
                    str = "auto";
                }
                Builder builder = new Builder();
                builder.path(str);
                for (String str2 : bundle.keySet()) {
                    builder.appendQueryParameter(str2, bundle.getString(str2));
                }
                charSequence = builder.build().toString();
            }
            if (!TextUtils.isEmpty(charSequence)) {
                this.a.o().A.b(charSequence);
                h4 h4Var = this.a.o().B;
                Objects.requireNonNull((c) this.a.n);
                h4Var.b(System.currentTimeMillis());
            }
        }
    }

    public final boolean b() {
        if (!c()) {
            return false;
        }
        Objects.requireNonNull((c) this.a.n);
        if (System.currentTimeMillis() - this.a.o().B.a() > this.a.g.n(null, p.E0)) {
            return true;
        }
        return false;
    }

    public final boolean c() {
        return this.a.o().B.a() > 0;
    }
}
